clc;clear
v1 = 8; %基本风速
t=0:1:60;
% Tg = 10
% tg1 = 5
% vgmax = 3
vg = 0 .* (t < 5) + 1.5 * (1 - cos(2 * pi * ((t - 5) / 10))) .* (t >= 5 & t <= 15) +0 .* (t > 15);
% vrmax = 2
% tr1 = 5
% tr2 = 35
vr = 0 .* (t < 5) + (1/15) * (t - 5) .* (t >= 5 & t <= 35) +2 .* (t > 35);
% vnmax = 1
vn = 1 * (-rand(1,length(t))-1) .* cos(pi * t + 2 * pi * rand(1,length(t)));
v = v1 + vg + vr + vn; %组合风风速
plot(t,v)
xlabel('t/时间');
ylabel('v/风速');
